package com.itheima.d4_create_thread;

/**
 * 目标：掌握线程的创建方式一:继承Thread类
 */
public class ThreadTest1 {
    // main方法是由一条默认的主线程负责执行。
    public static void main(String[] args) {
        MyThread mt = new MyThread();
        mt.start();

        MyThread1 mt1 = new MyThread1("xiaoxi");
        mt1.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是美女"+i);
        }
    }
}

class MyThread extends Thread {
    @Override
    public void run() {

        for (int i = 0; i < 1000; i++) {
            System.out.println("我是帅哥" + i);
        }
    }
}
class MyThread1 extends Thread{
    private String name;

    @Override
    public void run() {
        for (int i = 0; i < 999; i++) {
            System.out.println("lall"+i);
        }
    }

    public MyThread1() {
    }

    public MyThread1(String name) {
        this.name = name;
    }


}